<template>
  <div class="colleague">
    <div class="colleague-list" v-for="item in personList" :key="item.name">
      <div class="colleague-list-left">
        <img
          src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic3.zhimg.com%2F50%2Fv2-5095f9e4ef2c7eea1b768b5647eebb42_hd.jpg&refer=http%3A%2F%2Fpic3.zhimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1637311823&t=b550299ce8baaf5cba6c539c24fcb6e0"
        />
      </div>
      <div class="colleague-list-centent">
        <p>{{ item.name }}</p>
        <p>{{ item.position }}</p>
      </div>
      <div class="colleague-list-right">
        <span v-if="item.onLine" class="colleague-list-right-online">在线</span>
        <span v-else class="colleague-list-right-outline">;离线</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      personList: [
        {
          name: "王小明",
          position: "前端开发",
          onLine: true,
        },
        {
          name: "李小明",
          position: "Java",
          onLine: true,
        },
        {
          name: "张小明",
          position: "PHP",
          onLine: false,
        },
        {
          name: "宋小明",
          position: "python",
          onLine: true,
        },
        {
          name: "曹小明",
          position: "golang",
          onLine: false,
        },
        {
          name: "靳小明",
          position: "IOS",
          onLine: true,
        },
        {
          name: "卫小明",
          position: "安卓",
          onLine: true,
        },
      ],
    };
  },
};
</script>

<style scoped>
.colleague {
  width: 100%;
  max-height: 355px;
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  overflow: "-moz-scrollbars-none";
  scrollbar-width: none; /*  火狐   */
}
.colleague::-webkit-scrollbar {
  display: none; /*  Chrome  */
  width: 0 !important ; /*  Chrome  */
}
.colleague .colleague-list:nth-last-child(1) {
  border-color: transparent;
}
.colleague-list {
  width: 100%;
  height: 71px;
  border-bottom: 1px solid #dcdfe6;
  padding: 10px 0;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}
.colleague-list:hover {
  background: #dbfefb;
}
.colleague-list-left,
.colleague-list-left img {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
}
.colleague-list-centent {
  flex: 1;
  padding-left: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.colleague-list-centent p:nth-child(1) {
  font-size: 14px;
  font-weight: bold;
}
.colleague-list-centent p:nth-child(2) {
  font-size: 12px;
  color: #999999;
}
.colleague-list-right {
  width: 100px;
  height: 50px;
  padding-top: 13px;
  display: flex;
  justify-content: flex-end;
}
.colleague-list-right span {
  display: inline-block;
  width: 52px;
  height: 24px;
  text-align: center;
  line-height: 26px;
  border-radius: 2px;
  border: 1px solid;
  font-size: 12px;
}
.colleague-list-right-online {
  border-color: #0d9aff;
  color: #0d9aff;
  background: #deeffb;
}
.colleague-list-right-outline {
  border-color: #fd41f0;
  color: #fd41f0;
  background: #feedfd;
}
</style>
